package com.treasure.mall.biz.entity.withdraw;

import com.treasure.mall.biz.entity.BasePO;
import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.zbq.common.ienum.withdraw.WithdrawEnums;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author zoul
 * @version 1.0
 * @date 2020/6/14 14:58
 * @Description 提现申请
 */
@Entity
@Table(name = "zb_withdraw_apply")
@Setter
@Getter
public class WithdrawPO extends BasePO {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "apply_id")
    private Long applyId;

    /**
     * 银行信息
     */
    @ManyToOne
    @JoinColumn(name = "bank_info_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private UserBankInfoPO bankPo;

    /**
     * 用户信息
     */
    @ManyToOne
    @JoinColumn(name = "user_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private UserPO userPo;

    /**
     * 提现金额
     */
    @Column(scale = 2, precision = 19, name = "apply_Money")
    private BigDecimal applyMoney = BigDecimal.ZERO;

    /**
     * 手续费
     */
    @Column(scale = 2, precision = 19, name = "apply_fee")
    private BigDecimal applyFee;

    /**
     * 提现状态 {@link WithdrawEnums.WithdrawStatus}
     */
    @Column(name = "withdraw_status")
    private WithdrawEnums.WithdrawStatus withdrawStatus;

    /**
     * 提现类型 {@link WithdrawEnums.WithdrawType}
     */
    @Column(name = "withdraw_type")
    private WithdrawEnums.WithdrawType withdrawType;

    /**
     * 拒绝原因
     */
    @Column(name = "refuse_reason")
    private String refuseReason;

    /**
     * 银行类型
     */
    @Column(name = "bank_name", length = 20)
    private String bankName;

    /**
     * 银行支行
     */
    @Column(name = "branch_bank_name", length = 100)
    private String branchBankName;

    /**
     * 银行卡号
     */
    @Column(name = "bank_no", length = 30)
    private String bankNo;

    /**
     * 持卡人姓名
     */
    @Column(name = "real_name", length = 20)
    private String realName;


}